package ui.tests;

import org.testng.Assert;
import pages.CompareProducts;
import pages.SearchProduct;

/**
 * Created by Vadim on 6/10/14.
 */
public class CommonTestSteps extends BasicTest {

    public void searchProduct(String productName) {
        SearchProduct page = new SearchProduct(driver);
        Assert.assertTrue(page.searchProduct(productName));
    }

    public void searchUnknownProduct(String productName) {
        SearchProduct page = new SearchProduct(driver);
        Assert.assertFalse(page.searchProduct(productName));
    }

    public void addToComparison() {
        CompareProducts page = new CompareProducts(driver);
        Assert.assertTrue(page.addProductToComparison());
    }

    public void isProductsCompared(){
        CompareProducts page = new CompareProducts(driver);
        Assert.assertTrue(page.compareProd());
    }

    public void isProductsInCompared(){
        CompareProducts page = new CompareProducts(driver);
        Assert.assertFalse(page.compareProd());
    }

}
